package com.lrkj.payfee.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lrkj.common.annotation.Excel;
import com.lrkj.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.aspectj.weaver.ast.Or;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 收款单对象 tb_receipt
 *
 * @author yajun_ren
 * @date 2021-08-06
 */
@Data
public class Receipt extends BaseEntity implements Cloneable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private String receiptId;

    /**
     * 单号
     */
    @Excel(name = "单号")
    private String no;

    /**
     * 房屋ids 可以是多个房屋
     */
    @Excel(name = "房屋ids")
    private String roomId;

    /**
     * 业主ID
     */
    @Excel(name = "业主ID")
    private String ownerId;

    /**
     * 收款人
     */
    @Excel(name = "收款人")
    private String billUser;

    //收款人代码
    private String billUserCode;

    /**
     * 收款日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "收款日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date billDate;

    /**
     * 应收金额
     */
    @Excel(name = "应收金额")
    private BigDecimal receivableMoney;

    /**
     * 实收金额
     */
    @Excel(name = "实收金额")
    private BigDecimal billMoney;

    /**
     * 找零金额
     */
    @Excel(name = "找零金额")
    private BigDecimal oddChangeMoney;

    /**
     * 转存金额
     */
    @Excel(name = "转存金额")
    private BigDecimal transferAmount;

    //冲抵金额
    private BigDecimal amountAmount;

    /**
     * 优惠金额
     */
    @Excel(name = "优惠金额")
    private BigDecimal specialMoney;

    /**
     * 审核状态
     */
    @Excel(name = "审核状态")
    private String auditStatus;

    /**
     * 开票状态
     */
    @Excel(name = "开票状态")
    private String invoiceStatus;

    /**
     * 单据状态
     */
    @Excel(name = "单据状态")
    private String documentStatus;

    /**
     * 优惠政策
     */
    @Excel(name = "优惠政策")
    private String preferentialId;

    /**
     * 优惠折扣
     */
    @Excel(name = "优惠折扣")
    private String discount;


    //收款方式
    private List<ModePayment> modePayments;

    //收款明细
    private List<ReceiptDetail> receiptDetails;

    //房屋名称
    private String roomName;
    //业主名称
    private String ownerName;

    private String communityName;

    //预收金额
    private BigDecimal preMoney;

    //是否选中
    private boolean checked;

    private String communityId;

    //优惠政策名称
    private String favouredPolicyName;

    //打印模板ID
    private String printTempletId;

    //支付订单ID
    private String payOrderId;

    @Override
    public Object clone() {
        Receipt stu = null;
        try {
            stu = (Receipt) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return stu;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("receiptId", getReceiptId())
                .append("no", getNo())
                .append("roomId", getRoomId())
                .append("ownerId", getOwnerId())
                .append("billUser", getBillUser())
                .append("billDate", getBillDate())
                .append("receivableMoney", getReceivableMoney())
                .append("billMoney", getBillMoney())
                .append("oddChangeMoney", getOddChangeMoney())
                .append("transferAmount", getTransferAmount())
                .append("auditStatus", getAuditStatus())
                .append("invoiceStatus", getInvoiceStatus())
                .append("documentStatus", getDocumentStatus())
                .append("preferentialId", getPreferentialId())
                .append("discount", getDiscount())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
